package di.movie.main;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import di.movie.domain.Director;
import di.movie.domain.Movie;

public class TestMovie {
	public static void main(String[] args) {
		//id director1으로 설정된 bean객체를 받아와 출력.
		ApplicationContext context = new ClassPathXmlApplicationContext("di/movie/config/Movie.xml");
		
		Director d1 = (Director)context.getBean("director1");//식별자 키
		System.out.println(d1);
		
		Director d2 = (Director)context.getBean("director2");//식별자 키
		System.out.println(d2);
	
		Director d3 = (Director)context.getBean("director3");//식별자 키
		System.out.println(d3);
		
		Movie m1 = (Movie)context.getBean("movie1");
		System.out.println(m1);
		
		Movie m2 = (Movie)context.getBean("movie2");
		System.out.println(m2);
		
		Movie m3 = (Movie)context.getBean("director5");
		System.out.println(m3);
		
		Movie m4 = (Movie)context.getBean("movie4");
		System.out.println(m4);
	}
}
